package com.dljd.javase.t11.reader;


import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Arrays;

public class FileReaderDemo {

    public static void main(String[] args) {
        FileReader fr=null;
        try {
            fr=new FileReader("D:/Student.java");
            int len=-1;
            char[] cs=new char[1024];
            while((len=fr.read(cs))!=-1){
                System.out.print(Arrays.toString(cs));
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if(fr!=null)
            {
                try {
                    fr.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
